# -*- coding: utf-8 -*-(for Scipe)
#   glider  with electric motor
#____________flight control functions depending on @M1/_____________________________________
#use the stick M1 and make the flight variables:
#  courb  = flap, change the camber of the wing
#  thr = electric motor value -100 100
#  brake=  airbrake  value 0 100
DEF
courb.trim: INIT 0.00
IF  vol  # any flight condition prefixed with "vol" @M1= courb = the 4th axis
	courb	  ADD	@M1  courb.trim: #  4 axis ! courb >0 with the stick up
	thr  = -100.0  #off
ENDIF
thr.start: INIT 100
IF  vol.mot
	thr = thr.start:
ENDIF
brake.prof: INIT 0
IF  att #landing
	brake LINE @M1 -100   	0     	0     	0  100  100           # stick 1 /upper travel -> brake control (value 0  +100)
   	thr   LINE @M1 -100 100     	0  -100  100 -100             # stick 1 /lower travel -> motor control (value -100 +100)
	courb LINE @C3  -100 -100    +100 0                           # static position of the flaps controled with cursor 3
	prof  ADDS  brake brake.prof:
ENDIF
IF @S1 #Security switch electric motor
	thr = -100 #off
ENDIF
